Skip to content

fix: Material You charging icon and live widget theme colors - #100

Merged
LeanBitLab merged 4 commits into
mainfrom
fix/charging-icon-color
Nov 18, 2026
Merged

LeanBitLab merged 4 commits into
mainfrom
fix/charging-icon-color

Conversation

@LeanBitLab

@LeanBitLab LeanBitLab commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes a bug report that the charging icon did not match Material You, plus related widget refresh issues found while auditing.

  • Charging icon: the ⚡ emoji always rendered yellow and ignored the widget text color. It is now a Material "bolt" vector icon next to the battery percentage, tinted with the widget secondary color and sized from the battery text size (scales with the size setting).
  • Colors follow wallpaper and dark mode: theme-dependent colors were baked into the widget as ints, and CONFIGURATION_CHANGED never reaches manifest receivers, so colors stayed stale until the next update. On Android 12+ the widget now passes color resources (RemoteViews.setColor / setColorStateList), resolved by the launcher at draw time. "Follow system" mode uses night-qualified aliases.
  • Update interval setting: the repeating alarm only read the interval when first scheduled, so the slider had no effect until reboot or app update. It is now rescheduled when the slider changes (only if a widget is placed).
  • Alarm color: alarm-only partial updates used the secondary color instead of the alarm color.

Testing

  • ./gradlew assembleDebug, lintDebug (no errors)
  • Unit tests: ColorResolverTest (5 new cases), SystemStatsFetcherTest, MainActivitySmokeTest, AwidgetProviderScheduleTest
  • Installed on a POCO M2 Pro (API 37). Charging bolt icon (shape and color) checked on device; wallpaper and dark-mode switching still to be verified on device.

LeanBitLab added 4 commits November 18, 2026 23:33
The repeating alarm only read the interval when first scheduled, so
the settings slider had no effect until reboot or app update.
On Android 12+ pass color resources to RemoteViews so the launcher
resolves them at draw time; follow-system mode uses night-qualified
aliases. Colors no longer stay stale until the next widget update.
Also use the alarm color for alarm-only partial updates.
Replace the color emoji bolt with a text glyph so it follows
Material You and other theme colors instead of rendering yellow.
Replace the text glyph with a tinted vector icon next to the battery
percentage. It is rendered at the battery text size so it scales with
the size setting, and uses the widget secondary color.
@LeanBitLab
LeanBitLab merged commit a287e38 into main Nov 18, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/charging-icon-color branch November 18, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant